package com.mage.completeproject.config;

import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.boot.autoconfigure.ConfigurationCustomizer;
import org.springframework.context.annotation.Bean;

public class MybatisConfig {
    @Bean
    public ConfigurationCustomizer configurationCustomizer(){
        return new ConfigurationCustomizer() {
            @Override
            public void customize(Configuration configuration) {
                //开启驼峰命名法，如departmentName<——>department_name，等同于在主配置文件中添加mybatis.configuration.map-underscore-to-camel-case=true
                configuration.setMapUnderscoreToCamelCase(true);
            }
        };
    }
}
